<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>将要执行的任务出栈</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="worker.stack.html">« Worker::stack</a></li>
      <li style="float: right;"><a href="class.collectable.html">Collectable »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.worker.html">Worker</a></li>
    <li>将要执行的任务出栈</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="worker.unstack" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Worker::unstack</h1>
  <p class="verinfo">(PECL pthreads &gt;= 2.0.0)</p><p class="refpurpose"><span class="refname">Worker::unstack</span> &mdash; <span class="dc-title">将要执行的任务出栈</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-worker.unstack-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Worker::unstack</strong></span>(): <span class="type">int</span></div>

  <p class="para rdfs-comment">
   把 Worker 栈顶的（最老的那个）任务从栈中移除。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-worker.unstack-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-worker.unstack-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
  出栈之后，Worker 栈的大小。
  </p>
 </div>

 
 <div class="refsect1 changelog" id="refsect1-worker.unstack-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>v3</td>
       <td>
        移除了要出栈的任务参数。
        现在只能移除栈顶元素。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-worker.unstack-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3341">
    <p><strong>示例 #1 从 Worker 栈中移除对象</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$my&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Worker</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$work&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;class&nbsp;extends&nbsp;</span><span style="color: #0000BB">Threaded&nbsp;</span><span style="color: #007700">{};<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$my</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">stack</span><span style="color: #007700">(</span><span style="color: #0000BB">$work</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$my</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">unstack</span><span style="color: #007700">());</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
int(1)
int(0)
</pre></div>
    </div>
   </div>
  </p>
 </div>

</div></div></div></body></html>